/*    */ package com.zimbra.cs.db;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import java.sql.Connection;
/*    */ import java.sql.PreparedStatement;
/*    */ import java.sql.SQLException;
/*    */ import org.apache.commons.dbcp.DelegatingConnection;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ class DebugConnection
/*    */   extends DelegatingConnection
/*    */ {
/*    */   protected final Connection mConn;
/*    */   
/*    */   DebugConnection(Connection conn)
/*    */   {
/* 30 */     super(conn);
/* 31 */     this.mConn = conn;
/*    */   }
/*    */   
/*    */   Connection getConnection() {
/* 35 */     return this.mConn;
/*    */   }
/*    */   
/*    */   public PreparedStatement prepareStatement(String sql) throws SQLException {
/* 39 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql), sql);
/*    */   }
/*    */   
/*    */   public void commit() throws SQLException {
/* 43 */     ZimbraLog.sqltrace.debug("commit, conn=" + this.mConn.hashCode());
/* 44 */     this.mConn.commit();
/*    */   }
/*    */   
/*    */   public void rollback() throws SQLException {
/* 48 */     ZimbraLog.sqltrace.debug("rollback, conn=" + this.mConn.hashCode());
/* 49 */     this.mConn.rollback();
/*    */   }
/*    */   
/*    */   public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
/*    */     throws SQLException
/*    */   {
/* 55 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql, resultSetType, resultSetConcurrency), sql);
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
/*    */     throws SQLException
/*    */   {
/* 63 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability), sql);
/*    */   }
/*    */   
/*    */ 
/*    */   public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
/*    */     throws SQLException
/*    */   {
/* 70 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql, autoGeneratedKeys), sql);
/*    */   }
/*    */   
/*    */   public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
/*    */     throws SQLException
/*    */   {
/* 76 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql, columnIndexes), sql);
/*    */   }
/*    */   
/*    */   public PreparedStatement prepareStatement(String sql, String[] columnNames)
/*    */     throws SQLException
/*    */   {
/* 82 */     return new DebugPreparedStatement(this, this.mConn.prepareStatement(sql, columnNames), sql);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/db/DebugConnection.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */